Unconstrained log-contrast logistic or Poisson regression with compositional predictor variables.
ulc.glm(y, x, z = NULL, model = "logistic", xnew = NULL, znew = NULL)
A numerical vector containing the response variable values. This must be a continuous variable.
A matrix with the predictor variables, the compositional data. No zero values are allowed.
A matrix, data.frame, factor or a vector with some other covariate(s).
This can be either "logistic" or "poisson".
A matrix containing the new compositional data whose response is to be predicted. If you have no new data, leave this NULL as is by default.
A matrix, data.frame, factor or a vector with the values of some other covariate(s). If you have no new data, leave this NULL as is by default.
A list including:
The residual deviance of the logistic or Poisson regression model.
The constrained regression coefficients. Their sum equals 0.
If the arguments "xnew" and znew were given these are the predicted or estimated values, otherwise it is NULL.
The function performs the unconstrained log-contrast logistic or Poisson regression model. The logarithm of the
compositional predictor variables is used (hence no zero values are allowed). The response variable
is linked to the log-transformed data without the constraint that the sum of the regression coefficients
equals 0. If you want the regression without the zum-to-zero contraints see lc.glm
.
Extra predictors variables are allowed as well, for instance categorical or continuous.
Aitchison J. (1986). The statistical analysis of compositional data. Chapman & Hall.
Lu J., Shi P., and Li H. (2019). Generalized linear models with linear constraints for microbiome compositional data. Biometrics, 75(1): 235-244.
# NOT RUN {
y <- rbinom(150, 1, 0.5)
x <- rdiri(150, runif(3, 1,3))
mod <- ulc.glm(y, x)
# }
Run the code above in your browser using DataLab